select * from tblNonGGCarMoreDetails Where AdminID = 30875 Order by CoverageStart DESC

select * from tblCXBrokerPremium Where CECarID = 30996
select * from tblCEUser Where CEID = 30996 OR CEID = 888

Declare @CreatedDate DateTime
SET @CreatedDate = 'Jan 29 2013 10:54AM'
Select @CreatedDate

select SubString(Info5, 10, 20), CAST(SubString(Info5, 10, 20) as DateTime) AS CreatedDate from tblNonGGCarMoreDetails Where AdminID = 30875 Order by CoverageStart DESC

select pc.CompanyName, m.Package, m.QuoteRefNo, m.CarPlate, m.CoverageStart, 
CASE m.InsuranceType 
	WHEN 10 THEN 'Class 1'
	WHEN 11 THEN 'Class 1 (Low Cost)'
	WHEN 21 THEN 'Class 2+'
	WHEN 30 THEN 'Class 3'
	WHEN 31 THEN 'Class 3+' 
END InsuranceType,
m.Title, m.CustomerName, m.TotalCollectedPremium, m.CTPL, m.CreatedDate  
from tblNonGGCarMoredetails m 
INNER JOIN tblProviderCompany pc ON m.ProviderCompanyID = pc.ProviderCompanyID
Where m.Info5 Like '%OLDQuote%' Order By CoverageStart dESC

select top 10 * from  tblNonGGCarMoredetails 